#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
using namespace std;


void bubblesort(vector<int>& v)
{
	int i = 0;
	for (i = 1; i < v.size(); ++i)
	{
		int flag = 1;
		for (int j = 0; j < v.size() - i; ++j)
		{
			if (v[j] > v[j + 1])
			{
				swap(v[j], v[j + 1]);
				flag = 0;
			}
		}
		if (flag)
			return;
	}
	return;
}

int main()
{
	srand(time(nullptr));
	vector<int> v;
	for (int i = 0; i < 100; ++i)
	{
		v.push_back((int)rand());
	}
	bubblesort(v);
	for (auto e : v)
	{
		printf("%-5d ", e);
	}
	cout << endl;
	return 0;
}